package com.tuanzi.blog.web;

import com.tuanzi.blog.service.BlogService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;

/**
 * 雄关漫道真如铁，而今迈过从头越
 **/

/**
 * 归档
 */

@Controller
public class ArchiveController {

    @Resource
    private BlogService blogService;

    @GetMapping("/archives")
    public String archive(Model model){

        model.addAttribute("archiveMap",blogService.archiveBlogs());
        model.addAttribute("blogCount",blogService.countBlog());

        return "archives";
    }

}
